package com.ruoyi.dispatch.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.dispatch.mapper.CoalSalesTypeMapper;
import com.ruoyi.dispatch.domain.CoalSalesType;
import com.ruoyi.dispatch.service.ICoalSalesTypeService;

/**
 * 销售煤种配置Service业务层处理
 * 
 * @author wuxiaofang
 * @date 2025-04-10
 */
@Service
public class CoalSalesTypeServiceImpl implements ICoalSalesTypeService 
{
    @Autowired
    private CoalSalesTypeMapper coalSalesTypeMapper;

    /**
     * 查询销售煤种配置
     * 
     * @param typeId 销售煤种配置主键
     * @return 销售煤种配置
     */
    @Override
    public CoalSalesType selectCoalSalesTypeByTypeId(Long typeId)
    {
        return coalSalesTypeMapper.selectCoalSalesTypeByTypeId(typeId);
    }

    /**
     * 查询销售煤种配置列表
     * 
     * @param coalSalesType 销售煤种配置
     * @return 销售煤种配置
     */
    @Override
    public List<CoalSalesType> selectCoalSalesTypeList(CoalSalesType coalSalesType)
    {
        return coalSalesTypeMapper.selectCoalSalesTypeList(coalSalesType);
    }

    /**
     * 新增销售煤种配置
     * 
     * @param coalSalesType 销售煤种配置
     * @return 结果
     */
    @Override
    public int insertCoalSalesType(CoalSalesType coalSalesType)
    {
        coalSalesType.setCreateTime(DateUtils.getNowDate());
        return coalSalesTypeMapper.insertCoalSalesType(coalSalesType);
    }

    /**
     * 修改销售煤种配置
     * 
     * @param coalSalesType 销售煤种配置
     * @return 结果
     */
    @Override
    public int updateCoalSalesType(CoalSalesType coalSalesType)
    {
        coalSalesType.setUpdateTime(DateUtils.getNowDate());
        return coalSalesTypeMapper.updateCoalSalesType(coalSalesType);
    }

    /**
     * 批量删除销售煤种配置
     * 
     * @param typeIds 需要删除的销售煤种配置主键
     * @return 结果
     */
    @Override
    public int deleteCoalSalesTypeByTypeIds(Long[] typeIds)
    {
        return coalSalesTypeMapper.deleteCoalSalesTypeByTypeIds(typeIds);
    }

    /**
     * 删除销售煤种配置信息
     * 
     * @param typeId 销售煤种配置主键
     * @return 结果
     */
    @Override
    public int deleteCoalSalesTypeByTypeId(Long typeId)
    {
        return coalSalesTypeMapper.deleteCoalSalesTypeByTypeId(typeId);
    }
}
